package com.szrt.javaweb;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class HelloController {
	@RequestMapping(value="/hello")
	public String hello(){
		return "success";
	}
	
	//http://localhost:8080/mvn-springmvc-01-1609/paramsDemo?teacherAge=33&school=szrt
	@RequestMapping(value="/paramsDemo",method=RequestMethod.GET,params="school=szrt")
	public String paramsDemo01(String teacherAge){
		System.out.println("进入paramsDemo01 szrt方法....");
		System.out.println(teacherAge);
		return "success";
	}
	
	//http://localhost:8080/mvn-springmvc-01-1609/paramsDemo?teacherAge=33&school=itjob
	@RequestMapping(value="/paramsDemo",method=RequestMethod.GET,params="school=itjob")
	public String paramsDemo02(String teacherAge){
		System.out.println("进入paramsDemo02 itjob方法....");
		System.out.println(teacherAge);
		return "success";
	}
	
	//http://localhost:8080/mvn-springmvc-01-1609/headersDemo?teacherAge=33&school=szrt
	@RequestMapping(value="/add",method=RequestMethod.GET,
			params="school=szrt",headers="laoshi=huanglaoshi")
	public String headersDemo(String teacherAge){
		System.out.println("进入headersDemo szrt方法....");
		System.out.println(teacherAge);
		return "success";
	}
	
	//http://localhost:8080/mvn-springmvc-01-1609/find
	//http://localhost:8080/mvn-springmvc-01-1609/fin
	//http://localhost:8080/mvn-springmvc-01-1609/findxyz
	@RequestMapping(value="/fin*")
	public String find(){
		System.out.println("进入find方法....");
		return "success";
	}
	
}
